/*     */ package com.jcrj.action.info;
/*     */ 
/*     */ import com.jcrj.action.BaseAction;
/*     */ import com.jcrj.entity.ONotice;
/*     */ import com.jcrj.entity.OUser;
/*     */ import com.jcrj.service.InfoManagerService;
/*     */ import com.jcrj.service.SysLogService;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintWriter;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class NoticeAction extends BaseAction
/*     */ {
/*     */   private InfoManagerService infoManagerService;
/*     */   private long totalCount;
/*     */   private long pageCount;
/*     */   private String[] orgs;
/*     */   private List<ONotice> noticeList;
/*     */   private int docId;
/*     */   private String name;
/*     */   private SysLogService sysLogService;
/*     */ 
/*     */   public InfoManagerService getInfoManagerService()
/*     */   {
/*  24 */     return this.infoManagerService;
/*     */   }
/*     */   public void setInfoManagerService(InfoManagerService infoManagerService) {
/*  27 */     this.infoManagerService = infoManagerService;
/*     */   }
/*     */   public long getTotalCount() {
/*  30 */     return this.totalCount;
/*     */   }
/*     */   public void setTotalCount(long totalCount) {
/*  33 */     this.totalCount = totalCount;
/*     */   }
/*     */   public long getPageCount() {
/*  36 */     return this.pageCount;
/*     */   }
/*     */   public void setPageCount(long pageCount) {
/*  39 */     this.pageCount = pageCount;
/*     */   }
/*     */ 
/*     */   public String[] getOrgs() {
/*  43 */     return this.orgs;
/*     */   }
/*     */   public void setOrgs(String[] orgs) {
/*  46 */     this.orgs = orgs;
/*     */   }
/*     */   public List<ONotice> getNoticeList() {
/*  49 */     return this.noticeList;
/*     */   }
/*     */   public void setNoticeList(List<ONotice> noticeList) {
/*  52 */     this.noticeList = noticeList;
/*     */   }
/*     */   public int getDocId() {
/*  55 */     return this.docId;
/*     */   }
/*     */   public void setDocId(int docId) {
/*  58 */     this.docId = docId;
/*     */   }
/*     */ 
/*     */   public String noticeOrg() {
/*  62 */     return "success";
/*     */   }
/*     */ 
/*     */   public String noticeListManage() {
/*     */     try {
/*  67 */       OUser user = (OUser)super.getSession().get("userInfo");
/*  68 */       String orgs = this.infoManagerService.getUserAllOrgs(user.getOrgId().intValue());
/*  69 */       boolean role = this.infoManagerService.getRoleByUser(user.getId().intValue());
/*  70 */       this.totalCount = this.infoManagerService.countNoticeAll(orgs, this.name, super.getStartDate(), super.getEndDate(), super.getTitle(), role);
/*  71 */       this.pageCount = ((this.totalCount - 1L) / 10L + 1L);
/*  72 */       if (super.getCurrentPage() > this.pageCount) {
/*  73 */         super.setCurrentPage(Long.valueOf(this.pageCount).intValue());
/*     */       }
/*  75 */       this.noticeList = this.infoManagerService.findNoticeList(super.getCurrentPage(), orgs, this.name, super.getStartDate(), super.getEndDate(), super.getTitle(), role);
/*     */     } catch (Exception e) {
/*  77 */       e.printStackTrace();
/*     */     }
/*  79 */     return "success";
/*     */   }
/*     */ 
/*     */   public String saveNoticeInfo() {
/*     */     try {
/*  84 */       OUser user = (OUser)super.getSession().get("userInfo");
/*  85 */       this.infoManagerService.saveNotice(this.docId, this.orgs, user);
/*  86 */       super.getResponse().getWriter().write("success");
/*  87 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/*  89 */       e.printStackTrace();
/*     */       try
/*     */       {
/*  92 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/*  94 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/*  92 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/*  94 */         e.printStackTrace();
/*     */       }
/*     */     }
/*  97 */     return null;
/*     */   }
/*     */ 
/*     */   public String deleteNotice() {
/*     */     try {
/* 102 */       OUser user = (OUser)super.getSession().get("userInfo");
/* 103 */       this.infoManagerService.deleteNotice(this.orgs);
/* 104 */       this.sysLogService.saveLog("信息管理", user.getName(), "删除了通知通报信息");
/* 105 */       super.getResponse().getWriter().write("success");
/* 106 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 108 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 111 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e1) {
/* 113 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 111 */         super.getResponse().getWriter().close();
/*     */       } catch (IOException e) {
/* 113 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 116 */     return null;
/*     */   }
/*     */   public SysLogService getSysLogService() {
/* 119 */     return this.sysLogService;
/*     */   }
/*     */   public void setSysLogService(SysLogService sysLogService) {
/* 122 */     this.sysLogService = sysLogService;
/*     */   }
/*     */   public String getName() {
/* 125 */     return this.name;
/*     */   }
/*     */   public void setName(String name) {
/* 128 */     this.name = name;
/*     */   }
/*     */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.action.info.NoticeAction
 * JD-Core Version:    0.6.0
 */